package com.dandelion.common.domain;

import java.io.Serializable;

public class AddressTreeVO implements Serializable {
    public static final AddressTreeVO EMPTY = new AddressTreeVO("0", "无");
    public static final AddressTreeVO BJ = new AddressTreeVO("101101", "北京市");
    public static final AddressTreeVO SH = new AddressTreeVO("103101", "上海市");

    public static boolean isDirectProvince(String code) {
        return BJ.getCode().equals(code) || SH.getCode().equals(code);
    }

    public static AddressTreeVO toDirectProvince(String code) {
        if (BJ.getCode().equals(code)) {
            return BJ;
        }
        return SH;
    }

    private String code;
    private String name;

    public AddressTreeVO() {
    }

    public AddressTreeVO(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String id) {
        this.code = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
